// 云函数入口文件
const cloud = require('wx-server-sdk')
 
cloud.init({
  env: cloud.DYNAMIC_CURRENT_ENV
})
 
// 云函数获取数据写法
exports.main = async (event, context) => {
  let openId = event.openId
  let user_default = event.user_default
  let star = true
  return cloud.database().collection('subject-all')
  .where({
    _openid:openId,
    subject:user_default,
    star: star
  })
  .get()

  
}